00001 #ifndef DESTINY3D_EXPORTER_HPP 00002 #define DESTINY3D_EXPORTER_HPP 00003 00004 #define WIN32_LEAN_AND_MEAN 00005 00006 #define FLEXPORTER_API 00007 #include <FlexporterSDK_IceCore.h> 00008 #include <FlexporterSDK.h> 00009 #include <FLX_CropValues.h> 00010 00011 #define USING_DESTINY3D 00012 #define DESTINY3D_STATIC_LINK 00013 #include "deGlobalTypes.hpp" 00014 #include "deWorld.hpp" 00015 #include "deArray.hpp" 00016 #include "deList.hpp" 00017 #include "deMesh.hpp" 00018 00019 class IdeSceneABT; 00020 class IdeBitmapProxy; 00021 class IdeRenderTexture; 00022 class IdeSceneRoom; 00023 class IdeSurface; 00024 00025 class Destiny3DFormat : public ExportFormat 00026 { 00027 public: 00028 // constructor, destructor 00029 Destiny3DFormat(); 00030 virtual ~Destiny3DFormat(); 00031 00032 // Exporter init 00033 override(ExportFormat) bool Init (bool motion); 00034 00035 // Main scene info 00036 override(ExportFormat) bool SetSceneInfo (const MainDescriptor& maininfo); 00037 00038 // Export loop 00039 override(ExportFormat) bool ExportCamera (const CameraDescriptor& camera); 00040 override(ExportFormat) bool ExportController (const ControllerDescriptor& controller); 00041 override(ExportFormat) bool ExportHelper (const HelperDescriptor& helper); 00042 override(ExportFormat) bool ExportLight (const LightDescriptor& light); 00043 override(ExportFormat) bool ExportMaterial (const MaterialDescriptor& material); 00044 override(ExportFormat) bool ExportMesh (const MeshDescriptor& mesh); 00045 override(ExportFormat) bool ExportMotion (const MotionDescriptor& motion); 00046 override(ExportFormat) bool ExportShape (const ShapeDescriptor& shape); 00047 override(ExportFormat) bool ExportTexture (const TextureDescriptor& texture); 00048 override(ExportFormat) bool ExportSpaceWarp (const SpaceWarpDescriptor& space_warp); 00049 00050 // End of export notification 00051 override(ExportFormat) bool EndExport (const StatsDescriptor& stats); 00052 00053 // About box 00054 override(CustomFormat) void About (); 00055 00056 private: 00057 struct FlexPortBase 00058 { 00059 sdword ObjectID; 00060 char* Name; 00061 }; 00062 struct FlexPortTexture : public FlexPortBase 00063 { 00064 TextureTransform Transform; 00065 UVWSource SourceUVW; 00066 udword MapChannel; 00067 long AddressU, AddressV; 00068 IdeBitmapProxy* BitmapProxy; 00069 }; 00070 struct FlexPortMaterial : public FlexPortBase 00071 { 00072 TextureTransform Transform; 00073 00074 deColor AmbientColor; 00075 deColor DiffuseColor; 00076 deColor SpecularColor; 00077 deColor EmissiveColor; 00078 00079 sdword DiffuseMapID; 00080 sdword OpacityMapID; 00081 sdword BumpMapID; 00082 IdeSurface* FinalSurface; 00083 }; 00084 struct MeshMaterialInfo 00085 { 00086 sdword MatID; 00087 udword NumVerts; 00088 udword NumFaces; 00089 }; 00090 struct FlexPortMeshData 00091 { 00092 MeshMaterialInfo Material; 00093 deMeshVertexData Vertices; 00094 deMeshIndexData Indices; 00095 }; 00096 struct FlexPortInstanceMesh : public FlexPortBase 00097 { 00098 sdword ThisID; 00099 sdword MasterID; 00100 NakedPRS Position; 00101 deTArray<FlexPortMeshData>*MeshData; 00102 }; 00103 bool m_EngineInited; 00104 bool m_IsMotionFile; 00105 deWorldID m_WorldID; 00106 deTArray<FlexPortTexture> m_Textures; 00107 deTArray<FlexPortMaterial> m_Materials; 00108 deTArray<FlexPortInstanceMesh> m_Meshes; 00109 deTList<FlexPortInstanceMesh> m_InstanceMeshes; 00110 IdeRenderTexture* m_NullTexture; 00111 IdeSceneRoom* m_SceneRoom; 00112 IdeSceneABT* m_ABT; 00113 00114 typedef deTArray<FlexPortTexture>::iterator TexIterator; 00115 typedef deTArray<FlexPortMaterial>::iterator MatIterator; 00116 typedef deTArray<FlexPortInstanceMesh>::iterator MeshIterator; 00117 }; 00118 00119 static inline deColor Make_deColor(const NakedPoint& pt) 00120 { 00121 deColor color; 00122 color.r = pt.r; 00123 color.g = pt.g; 00124 color.b = pt.b; 00125 color.a = 0; 00126 return color; 00127 } 00128 00129 #endif
1.3-rc3